{% extends 'layout.html.twig' %}
{% block body %}
  <div class="iframe-parent-content">
    <div  class="modal show iframe-modal">
      <div class="modal-dialog ">
        <div class="modal-content">
          <div class="modal-body task-state-modal">
            <div class="title font-blod">
              <i class="es-icon es-icon-xinxi color-info"></i>{{'course.plan_task.activity_manage.testpaper.info'|trans}}
            </div>
            {% set testMode = activity.ext.answerScene.start_time > 0 ? 'realTime' : 'normal' %}
            {% if testpaper and testpaper.status == 'open' %}
              <div class="content">
                {% if testMode == 'realTime' and activity.startTime and activity.startTime > "now"|date("U") %}
                  <div class="text-16 ">
                    {{'course.plan_task.activity_manage.testpaper.will_begin_tips'|trans({'%startTime%':activity.startTime|date('Y-m-d H:i:s')})}}
                  </div>
                {% else %}
                  <div class="text-16 ">
                    {{'course.plan_task.activity_manage.testpaper.total_question'|trans({'%itemCount%':testpaper.item_count, '%score%':testpaper.total_score})|raw}}
                    {% if activity.finishType|default('') == 'score' %}
                      {{'course.plan_task.activity_manage.testpaper.pass_score'|trans({'%finishScore%': activity.ext.finishCondition.finishScore })|raw}}
                    {% endif %}
                    {% if activity.ext.answerScene.limited_time %}
                      <div class="mt5">
                        {{'course.plan_task.activity_manage.testpaper.answer'|trans({'%limitedTime%': activity.ext.answerScene.limited_time})|raw}}
                      </div>
                    {% endif %}
                    {% if activity.ext.answerScene.do_times %}
                      {{'course.plan_task.activity_manage.testpaper.once_trance'|trans|raw}}
                    {% endif %}
                  </div>
                {% endif %}
              </div>
              <div class="text-right mtl">
                {#
                # @deprecated activity.startTime
                # @refactor with answerScene.start_time
                #}
                {% if not activity.startTime or testMode == 'normal' or (testMode == 'realTime' and activity.startTime and activity.startTime <= "now"|date("U")) %}
                  <a class="btn btn-primary" href="{{ path('testpaper_do',{lessonId:activity.id,testId: testpaper.id})}}">{{'course.plan_task.activity_manage.testpaper.start_exam'|trans}}</a>
                {% endif %}
              </div>
            {% else %}
              <div class="content">
                <div class="text-16 ">{{'course.plan_task.activity_manage.testpaper.close_tips'|trans}}</div>
              </div>
            {% endif %}
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="modal-backdrop in"></div>
{% endblock %}
